'\" te
.\" Copyright (c) 2009 Sun Microsystems, Inc.  All Rights Reserved.
.\" Copyright (c) 2020 Peter Tribble.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH N2RNG 4D "Jan 12, 2020"
.SH NAME
n2rng \- Ultra-SPARC T2 random number generator device driver
.SH DESCRIPTION
The \fBn2rng\fR device driver is a multi-threaded, loadable hardware driver
supporting hardware assisted random numbers.
This support is built into the Ultra-SPARC T2 and later processors.
.sp
.LP
The \fBn2rng\fR driver requires the presence of the Solaris Cryptographic
Framework to enable applications and kernel clients to access the provided
services.
.SH CONFIGURATION
You configure the \fBn2rng\fR driver by defining properties in
\fB/platform/sun4v/kernel/drv/n2rng.conf\fR which override the default settings.
The following property is supported:
.sp
.ne 2
.na
\fBnostats\fR
.ad
.RS 28n
Disables the generation of statistics.
The nostats property may be used to help prevent traffic analysis, however,
this may inhibit support personnel.
.RE

.SH CRYPTO STATISTICS
Solaris crypto drivers must implement statistics variables.
Statistics reported by \fBn2rng\fR may be read using the \fBkstat\fR(8)
utility.
The \fBn2rng\fR driver maintains the following statistics:
.sp
.ne 2
.na
\fBstatus\fR
.ad
.RS 28n
Status (online, offline, fail) of RNG device.
.RE

.sp
.ne 2
.na
\fBrngjobs\fR
.ad
.RS 28n
Number of requests for random data.
.RE

.sp
.ne 2
.na
\fBrngbytes\fR
.ad
.RS 28n
Number of bytes read from the RNG device.
.RE

.SH KERNEL STATISTICS
The \fBn2rng\fR driver tallies a set of kernel driver statistics when in the
Control domain.
Statistics reported by \fBn2rng\fR may be read using the \fBkstat\fR(8)
utility.
.sp
.ne 2
.na
\fBrng(n)-cell0-bias\fR
.ad
.RS 28n
Bias setting for noise cell 0 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-cell0-entropy\fR
.ad
.RS 28n
Entropy value for noise cell 0 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-cell1-bias\fR
.ad
.RS 28n
Bias setting for noise cell 1 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-cell1-entropy\fR
.ad
.RS 28n
Entropy value for noise cell 1 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-cell2-bias\fR
.ad
.RS 28n
Bias setting for noise cell 2 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-cell2-entropy\fR
.ad
.RS 28n
Entropy value for noise cell 2 of RNG \fIn\fR.
.RE

.sp
.ne 2
.na
\fBrng(n)-state\fR
.ad
.RS 28n
State of rng number n (online, offline, error, health check).
.RE

.SH FILES
.ne 2
.na
\fB/platform/sun4v/kernel/drv/sparcv9/n2rng\fR
.ad
.sp .6
.RS 4n
Device driver (SPARC)
.RE

.sp
.ne 2
.na
\fB/platform/sun4v/kernel/drv/n2rng.conf\fR
.ad
.sp .6
.RS 4n
Driver configuration file
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	SPARC
_
Interface stability	Committed
.TE

.SH SEE ALSO
.BR attributes (7),
.BR cryptoadm (8),
.BR kstat (8)
